import axios from './request'


// 首页数据接口
export const GetHomeData = () => axios.get("/index/index")
// 搜索窗口数据
export const GetHisData = () => axios.get("/search/index")
// export const GetSearchData = (val) => axios.get("/search/helper", {
//     params: {
//         keyword: val
//     }
// })

// 实时搜索功能
export const GetSearchData = (params) => axios.get("/search/helper", { params})


// 请求所搜产品列表
export const GetgoodData = (params) => axios.get("/goods/list", { params})

// 清除历史记录
export const postclearhistoryData = () => axios.post("/search/clearhistory")

//登录请求
export const postdenglu = (params) => axios.post("/auth/loginByWeb",  params)


// 商品详情
export const GetDetails = (params) => axios.get("/goods/detail", { params})
export const GetRelated = (params) => axios.get("/goods/related", { params})

// 获取购物车数量
export const GetCartNum = () => axios.get("/cart/goodscount")


// 发起加入购物车请求/cart/add
export const postToAddCart = (params) => axios.post("/cart/add",  params)

// 获取购物车数据/cart/index
export const GetCartData = () => axios.get("/cart/index")
// 点击商品发起请求数据/cart/checked
export const GetGoodils = (params) => axios.post("/cart/checked", params)
// /cart/update步进器
export const Getbujin = (params) => axios.post("/cart/update", params)
// /cart/delete删除商品
export const Getdel = (params) => axios.post("/cart/delete", params)



// 专题 /topic/list
export const GetSpecial = (params) => axios.get("/topic/list", { params})

